<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\model\Ann;
use app\common\model\Banner;
use app\common\model\Contact as ModelContact;
use app\common\model\Link as ModelLink;

/**
 * 友情链接接口
 */
class Link extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * @Author LK
     * @ApiTitle (列表)
     * @ApiMethod (GET)
     * @ApiReturnParams (name="code", type="integer", required=true, description="")
     * @ApiReturn ({'code':1,'msg':'返回成功'})
     */
    public function list()
    {
        $data = ModelLink::paginate();
        $this->success('请求成功', $data);
    }
    /**
     * @Author LK
     * @ApiTitle (详情)
     * @ApiMethod (GET)
     * @ApiParams (name="id", type="integer", required=true, sample="", description="ID")
     * @ApiReturnParams (name="code", type="integer", required=true, description="")
     * @ApiReturn ({'code':1,'msg':'返回成功'})
     */
    public function info()
    {
        $param = request()->param();
        extract($param);
        $data = ModelLink::get($id);
        $this->success('请求成功', $data);
    }
}
